//
//  QrCode.h
//  gdemm
//
//  Created by 乔明超 on 16/5/9.
//  Copyright © 2016年 Goldencis. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <AVFoundation/AVFoundation.h>
#import <UIKit/UIKit.h>
@interface QrCode : NSObject<AVCaptureMetadataOutputObjectsDelegate>
@property (strong, nonatomic) UIView *boxView;
@property (strong, nonatomic) CALayer *scanLayer;
@property (strong, nonatomic) NSTimer *timer;
@property (assign, nonatomic) BOOL addFlag;
@property (assign, nonatomic) int dir;

@property (strong, nonatomic) UIView *scanView;

typedef void (^setMsgHandler)(NSString *msg);
@property (strong, nonatomic) setMsgHandler callback;

@property (nonatomic, strong) AVCaptureSession *captureSession;
@property (nonatomic, strong) AVCaptureVideoPreviewLayer *videoPreviewLayer;

-(BOOL)startReading:(setMsgHandler) setmsg;
-(void)stopReading;
-(instancetype)initWithSupperView:(UIView *)scanView;
@end
